package hot;

/**
 * @author lakersUp
 * @Classname
 * @Description
 * @Date 2022/3/8 15:35
 * @Version 1.0
 */
public class Hot11maxArea {
    public int maxArea(int[] height) {
        int i=0;
        int j=height.length-1;
        int max=0;
        while(i<j){
            int tmp=(j-i)*Math.min(height[i],height[j]);
            max=Math.max(max,tmp);
            if(height[i]<=height[j]){
                i++;
            }else {
                j--;
            }
        }
        return max;
    }
}
